/*
 * Powered By XY
 * Since 2020
 */

package com.xy.biz.xd.service;

import com.xy.biz.uc.domain.dto.UserDTO;
import com.xy.biz.xd.domain.bo.DocumentFlowBO;
import com.xy.biz.xd.domain.bo.DocumentFlowHandleUserBO;
import com.xy.biz.xd.domain.query.DocumentFlowHandleUserQuery;
import com.xy.biz.xd.domain.query.DocumentFlowQuery;
import com.xy.biz.xd.domain.req.GetDocumentFlowExistRequest;
import com.xy.biz.xd.domain.req.GetDocumentFlowRequest;
import com.xy.biz.xd.domain.req.HandleDocumentFlowRequest;
import com.xy.biz.xd.domain.req.SaveDocumentFlowHandleUserRequest;
import com.xy.biz.xd.domain.resp.DocumentAllInfoResponse;
import com.xy.biz.xd.domain.resp.DocumentFlowTodoResponse;
import com.xy.biz.xd.domain.resp.GetDocumentFlowHandleUserResponse;
import com.xy.biz.xd.domain.resp.GetDocumentFlowResponse;
import com.xy.lang.domain.Page;
import com.xy.lang.domain.Result;

import java.util.Collection;
import java.util.List;

/**
 *
 *
 * @author zsp
 * @date 2021-1-22
 */
public interface DocumentFlowService {

    /**
     * 删除
     *
     * @param documentFlowId
     */
    Result<?> deleteDocumentFlow(Long documentFlowId);

    /**
     * 查找一个
     *
     * @param documentFlowId
     * @return
     */
    DocumentFlowBO getDocumentFlow(Long documentFlowId);

    /**
     * 查找多个
     *
     * @param collection 标识集合
     */
    List<DocumentFlowBO> listDocumentFlowById(Collection<Long> collection);

    /**
     * 查找多个
     *
     * @param query 查找条件
     */
    List<DocumentFlowBO> listDocumentFlow(DocumentFlowQuery query);

    List<DocumentFlowBO> listDocumentFlow2(DocumentFlowQuery query);

    /**
     * 查找台账数据
     *
     * @param query 查找条件
     */
    Page<GetDocumentFlowResponse> listLedgerData(DocumentFlowQuery query);

    /**
     * 统计个数
     *
     * @param query 查找条件
     */
    int countDocumentFlow(DocumentFlowQuery query);

    /**
     * 查询当前的流程任务
     * @return
     */
    Page<GetDocumentFlowResponse> searchDocumentFlowTodo(DocumentFlowQuery query);

    /**
     * 待办事项任务统计
     * @return
     */
    int pageTodoDocumentFlowCount();

    /**
     * 判断有无相同流程
     * @param request
     * @return
     */
    Result<?> getFlowExist(GetDocumentFlowExistRequest request);

    Result<?> saveHandleUser(Collection<DocumentFlowHandleUserBO> request);

    Result<List<GetDocumentFlowHandleUserResponse>> listHandleUser(DocumentFlowHandleUserQuery query);

    /**
     * 获取生效处理所有文件信息
     * @param request
     * @return
     */
    Result<DocumentAllInfoResponse> getDocumentAllInfo(GetDocumentFlowRequest request);

    Result<List<UserDTO>> listAssignee(Long documentFlowId);

}
